package com.gym.code.generator.impl.dao;

import java.util.HashSet;
import java.util.Set;

import com.gym.code.generator.impl.AbstractImplGenerator;
import com.gym.code.generator.model.mapping.layer.LayerGenerateModel;
import com.gym.code.generator.model.mapping.layer.dao.DaoLayerGenerateModel;

/**
 * 
 * @author xinchun.wang 
   @email: 532002108@qq.com
 * @createTime 2015-5-23 下午8:44:53 
 * @param <T>
 */
public abstract class AbstractDaoGenerator<T extends DaoLayerGenerateModel> extends AbstractImplGenerator<T> {

	protected Set<String> generateSpringImport(){
		Set<String> result = new HashSet<String>();
		result.add("org.apache.commons.collections.CollectionUtils");
		result.add("org.springframework.stereotype.Repository");
		result.add("org.springframework.jdbc.core.RowMapper");
		result.add("org.springframework.jdbc.core.JdbcTemplate");
		result.add("org.apache.commons.lang.StringUtils");
		return result;
	}
	
	
	protected Set<String> generateJavaImport(){
		Set<String> result = new HashSet<String>();
		result.add("java.sql.ResultSet");
		result.add("java.sql.SQLException");
		result.add("java.util.Collections");
		return result;
	}
	
	@Override
	protected Set<String> generateFaceImport(LayerGenerateModel model) {
		Set<String> result = new HashSet<String>();
		//TODO
		result.add(model.getPackagePath() +".dao."+ ((DaoLayerGenerateModel)model).getDaoFaceName());
		return result;
	}
}
